/*****
author : searchNode
date: 2016/12/10
******/
import dataC from './data'
export default {
  search (val, select) {
    if (dataC.cy) {
      dataC.cy.nodes(function (i, node) {
        var data = node.data()
        var sV = ''
        if (select === '1') {
          sV = data['label'].indexOf(val)
        } else {
          sV = data['ip'].indexOf(val)
        }

        if (sV !== -1) {
          node.addClass('search')
        } else {
          node.removeClass('search')
        }
      })
    } 
  }
}
